//
//  CPYSingerInformationTableViewCell.m
//  TTMusic
//
//  Created by chenpengyu on 16/4/7.
//  Copyright © 2016年 cpy. All rights reserved.
//

#import "CPYSingerInformationTableViewCell.h"

@implementation CPYSingerInformationTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.singerImageView = [[UIImageView alloc] initWithFrame:CGRectZero];
        self.singerNameLabelAndLike = [[TTMusicBaseLabel alloc] initWithFrame:CGRectZero];
        self.songName = [[TTMusicBaseLabel alloc] initWithFrame:CGRectZero];
        [self.contentView addSubview:_singerImageView];
        [self.contentView addSubview:_singerNameLabelAndLike];
        [self.contentView addSubview:_songName];
    }
    return self;
}
- (void)layoutSubviews {
    [super layoutSubviews];
    _singerImageView.frame = CGRectMake(5, 5, self.contentView.bounds.size.height - 10, self.contentView.bounds.size.height - 10);
    _singerImageView.layer.masksToBounds = YES;
    _singerImageView.layer.cornerRadius = (self.contentView.bounds.size.height - 10) / 2;;
    _songName.frame = CGRectMake(self.contentView.bounds.size.height + 20, self.contentView.center.y - 35, self.contentView.bounds.size.width / 2, 30);
    _singerNameLabelAndLike.frame = CGRectMake(self.contentView.bounds.size.height + 20 , self.contentView.center.y + 5, self.contentView.bounds.size.width / 2 , 30);
    _songName.font = [UIFont systemFontOfSize:21];
    _singerNameLabelAndLike.font = [UIFont systemFontOfSize:16];
}
- (void)setSingerinformationModel:(CPYSingerInformationModel *)singerinformationModel {
    _singerinformationModel = singerinformationModel;
//    [_singerImageView sd_setImageWithURL:[NSURL URLWithString:singerinformationModel.picurl]];
    _songName.text = singerinformationModel.name;
    _singerNameLabelAndLike.text = [NSString stringWithFormat:@"%@💕%@", singerinformationModel.singerName, singerinformationModel.favorites];
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
